import axios, { AxiosInstance, AxiosResponse, InternalAxiosRequestConfig } from 'axios';

// 创建一个 Axios 实例
const request: AxiosInstance = axios.create({
  baseURL: 'http://127.0.0.1:11434',
  timeout: 0,
});

// 请求拦截器
request.interceptors.request.use(
  (config: InternalAxiosRequestConfig) => config,
  (error) => Promise.reject(error),
);

// 响应拦截器
request.interceptors.response.use(
  (response: AxiosResponse) => response,
  (error) => Promise.reject(error),
);

export default request;
